package com.hdmall.business.common.common;

import com.google.common.collect.Sets;

import java.util.Set;

public class Const {

    /**
     * 用来判断是财务的用户角色id
     */
    public static Integer FINANCE_ROLE_ID  = 112;

    /**
     * 用来判断是跟单员的部门id
     */
    public static Integer MERCH_DEPT_ID = 305;

    /**
     * 跟单员的类型
     */
    public static Integer MERCH_ROLE = 2;

    /**
     * 资金的类型
     */
    public static Integer FINANCE_ROLE = 3;

    /**
     * 通过审核的flag
     */
    public static Integer PASS_EXAM = 1;

    /**
     * 不通过审核的flag
     */
    public static Integer UNPASS_EXAM = 2;

    /**
     * 办事处端接受即时通讯消息的交换器
     */
    public static String BACK_MESSAGE_EXCHG = "back_message_exchg";

    /**
     * pc端接受即时通讯消息的交换器
     */
    public static String FRONT_MESSAGE_EXCHG = "front_message_exchg";

    /**
     * pc端接受推送的交换器
     */
    public static String HDMALL_DIRECT_EXCHG = "hmall_direct_exchg";

    /**
     * 前端标识符
     */
    public static final String BACK = "back";

    /**
     * 后端标识符
     */
    public static final String FRONT = "front";

    /**
     * 登录时的设备前缀信息（用来发极光推送）
     */
    public static final String ALIAS_PRE = "Alias-";

    /**
     * 如果浏览器关闭或者手机端关闭需要发到另一个队列上（rabbitmq）
     */
    public static final String DEVICE_OPEN = "open";

    public static final String DEVICE_CLOSE = "close";

    /**
     * 订单状态待审核
     */
    public static final Integer ORDER_WAIT_EXAM = 10;

    /**
     * 订单状态待发货
     */
    public static final Integer ORDER_WAIT_SEND = 20;

    /**
     * 订单状态已取消
     */
    public static final Integer ORDER_CANCEL = 0;

    /**
     * 订单状态交易完成
     */
    public static final Integer ORDER_FINISH = 50;

    /**
     * 订单状态发货中
     */
    public static final Integer ORDER_SENDING = 60;

    /**
     * 计划状态审核通过
     */
    public static final Integer PLAN_PASS = 1;

    /**
     * 计划状态审核拒绝
     */
    public static final Integer PLAN_UNPASS = 2;

    /**
     * 计划状态保存计划
     */
    public static final Integer PLAN_SAVE = 3;

    /**
     * 用户注册时候的图片
     */
    public static String FRONT_AVATOR1 = "http://hd-yun.oss-cn-hangzhou.aliyuncs.com/imgupload/1542330401567.png?Expires=1857690395&OSSAccessKeyId=LTAI0AE4IXlOaSaX&Signature=9KAS%2FMn7D8buLbLkjdZKW9jX3Lc%3D";

    public static String FRONT_AVATOR2 = "http://hd-yun.oss-cn-hangzhou.aliyuncs.com/imgupload/1542330419923.png?Expires=1857690413&OSSAccessKeyId=LTAI0AE4IXlOaSaX&Signature=l%2BHk2V%2Bf864Gxy%2FuHCvbbOLUmWc%3D";

    public static String FRONT_AVATOR3 = "http://hd-yun.oss-cn-hangzhou.aliyuncs.com/imgupload/1542330424807.png?Expires=1857690424&OSSAccessKeyId=LTAI0AE4IXlOaSaX&Signature=smorwrPPBRQWZjFmbeIOj1z6Paw%3D";

    public static String FRONT_AVATOR4 = "http://hd-yun.oss-cn-hangzhou.aliyuncs.com/imgupload/1542330444567.png?Expires=1857690435&OSSAccessKeyId=LTAI0AE4IXlOaSaX&Signature=wHgi%2FsYmalGAXQXD7QHuFgAM1kE%3D";

    public static String FRONT_AVATOR5 = "http://hd-yun.oss-cn-hangzhou.aliyuncs.com/imgupload/1542330456630.png?Expires=1857690449&OSSAccessKeyId=LTAI0AE4IXlOaSaX&Signature=kCMo87uCWi%2BB83hXLqN3zOS8IzM%3D";

    public static String FRONT_AVATOR6 = "http://hd-yun.oss-cn-hangzhou.aliyuncs.com/imgupload/1542330460685.png?Expires=1857690458&OSSAccessKeyId=LTAI0AE4IXlOaSaX&Signature=4U38EnjzhVKFKcXexqHfFTY9cRE%3D";

    public static String FRONT_AVATOR7 = "http://hd-yun.oss-cn-hangzhou.aliyuncs.com/imgupload/1542330470788.png?Expires=1857690468&OSSAccessKeyId=LTAI0AE4IXlOaSaX&Signature=I0padUfVGaEBPfolQQQOPLA7Wq4%3D";

    public static String FRONT_AVATOR8 = "http://hd-yun.oss-cn-hangzhou.aliyuncs.com/imgupload/1542330480962.png?Expires=1857690478&OSSAccessKeyId=LTAI0AE4IXlOaSaX&Signature=wm5FeZ%2BFMt%2FwFfU9yvUCPLyFI2Y%3D";

    public static String FRONT_AVATOR9 = "http://hd-yun.oss-cn-hangzhou.aliyuncs.com/imgupload/1542330489370.png?Expires=1857690487&OSSAccessKeyId=LTAI0AE4IXlOaSaX&Signature=CeLbpJOh0fHsjf7lbuM%2B0iAfQrA%3D";

    public interface Cart{
        /**
         * 即购物车选中状态
         */
        int CHECKED = 1;
        /**
         * 购物车中未选中状态
         */
        int UN_CHECKED = 0;

        String LIMIT_NUM_FAIL = "LIMIT_NUM_FAIL";
        String LIMIT_NUM_SUCCESS = "LIMIT_NUM_SUCCESS";
    }

    public static final String CURRENT_USER = "currentUser";

    public static final String EMAIL = "email";
    public static final String USERNAME = "username";

    public interface ProductListOrderBy{
        Set<String> PRICE_ASC_DESC = Sets.newHashSet("price_desc","price_asc");
    }

    public interface Role{
        int ROLE_CUSTOMER = 0; //普通用户
        int ROLE_ADMIN = 1;//管理员
    }

    public enum ProductStatusEnum{
        ON_SALE(1,"在线");
        private String value;
        private int code;
        ProductStatusEnum(int code,String value){
            this.code = code;
            this.value = value;
        }

        public String getValue() {
            return value;
        }

        public int getCode() {
            return code;
        }
    }


    public enum OrderStatusEnum{
        CANCELED(0,"已取消"),
        NO_PAY(10,"未支付"),
        PAID(20,"已付款"),
        SHIPPED(40,"已发货"),
        ORDER_SUCCESS(50,"订单完成"),
        ORDER_CLOSE(60,"订单关闭");


        OrderStatusEnum(int code,String value){
            this.code = code;
            this.value = value;
        }
        private String value;
        private int code;

        public String getValue() {
            return value;
        }

        public int getCode() {
            return code;
        }

        public static OrderStatusEnum codeOf(int code){
            for(OrderStatusEnum orderStatusEnum : values()){
                if(orderStatusEnum.getCode() == code){
                    return orderStatusEnum;
                }
            }
            throw new RuntimeException("么有找到对应的枚举");
        }
    }
    public interface  AlipayCallback{
        String TRADE_STATUS_WAIT_BUYER_PAY = "WAIT_BUYER_PAY";
        String TRADE_STATUS_TRADE_SUCCESS = "TRADE_SUCCESS";

        String RESPONSE_SUCCESS = "success";
        String RESPONSE_FAILED = "failed";
    }



    public enum PayPlatformEnum{
        ALIPAY(1,"支付宝");

        PayPlatformEnum(int code,String value){
            this.code = code;
            this.value = value;
        }
        private String value;
        private int code;

        public String getValue() {
            return value;
        }

        public int getCode() {
            return code;
        }
    }

    public enum PaymentTypeEnum{
        ONLINE_PAY(1,"在线支付");

        PaymentTypeEnum(int code,String value){
            this.code = code;
            this.value = value;
        }
        private String value;
        private int code;

        public String getValue() {
            return value;
        }

        public int getCode() {
            return code;
        }


        public static PaymentTypeEnum codeOf(int code){
            for(PaymentTypeEnum paymentTypeEnum : values()){
                if(paymentTypeEnum.getCode() == code){
                    return paymentTypeEnum;
                }
            }
            throw new RuntimeException("么有找到对应的枚举");
        }
    }
}
